<?php
App::uses('Osztaly', 'Model');

class OsztalyTest extends CakeTestCase {
	public $fixtures = array('app.osztaly', 'app.gyujto', 'app.gyujto_osztaly');
	
	public function setUp() {
		parent::setUp();
		$this->Osztaly = ClassRegistry::init('Osztaly');	//ezzel biztosítjuk, hogy használja az AB kapcsolatot
	}
	
	public function testIsValidId(){
		$actual = $this->Osztaly->getOsztalyId(11, array('ev' => 2012, 'cegId' => 2));
		$expected = 2;
		$this->assertEquals($expected, $actual);

		$actual = $this->Osztaly->getOsztalyId(1111, array('ev' => 2012, 'cegId' => 2));
		$expected = false;
		$this->assertEquals($expected, $actual);
	}
	
	public function testGetOsztalyNev(){
		$actual = $this->Osztaly->getNev(3);
		$expected = 'Controlling';
		$this->assertEquals($expected, $actual);
	}


}
?>